package com.clothing.bean;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

import com.clothing.entity.Article.Status;
import com.clothing.entity.ArticleImage;
import com.clothing.entity.ArticlePraise;
import com.clothing.utils.Utils;

public class ArticleJson
{
    private String creater;

    private String content;

    private Long areaId;
    
    private String areaName;
    
    private Long articleTypeId;
    
    private String articleTypeName;

    private Integer commentQuantity;

    private Integer praiseQuantity;
    
    private List<ArticleImage> images;
    
    private Long id;
    
    private String nickname;
    
    private Long publishDate;
    
    private Long userId;
    
    private String headImgUrl;
    
    private Status status;
    
    private String reason;
    
    private List<CommentJson> comments;
    
    private Double longitude;
    
    private Double latitude;
    
    private Integer browseQuantity;
    
    private String address;
    
    private String fullDate;
    
    private Boolean praise;

    private Boolean deleted;
    
    public Double getLongitude()
    {
        return longitude;
    }

    public void setLongitude(Double longitude)
    {
        this.longitude = longitude;
    }

    public Double getLatitude()
    {
        return latitude;
    }

    public void setLatitude(Double latitude)
    {
        this.latitude = latitude;
    }

    public Integer getBrowseQuantity()
    {
        return browseQuantity;
    }

    public void setBrowseQuantity(Integer browseQuantity)
    {
        this.browseQuantity = browseQuantity;
    }

    public String getAddress()
    {
        return address;
    }

    public void setAddress(String address)
    {
        this.address = address;
    }

    public String getCreater()
    {
        return creater;
    }

    public void setCreater(String creater)
    {
        this.creater = creater;
    }

    public String getContent()
    {
        return content;
    }

    public void setContent(String content)
    {
        this.content = content;
    }

    public Long getAreaId()
    {
        return areaId;
    }

    public void setAreaId(Long areaId)
    {
        this.areaId = areaId;
    }

    public String getAreaName()
    {
        return areaName;
    }

    public void setAreaName(String areaName)
    {
        this.areaName = areaName;
    }

    public Long getArticleTypeId()
    {
        return articleTypeId;
    }

    public void setArticleTypeId(Long articleTypeId)
    {
        this.articleTypeId = articleTypeId;
    }

    public String getArticleTypeName()
    {
        return articleTypeName;
    }

    public void setArticleTypeName(String articleTypeName)
    {
        this.articleTypeName = articleTypeName;
    }

    public Integer getCommentQuantity()
    {
        return commentQuantity;
    }

    public void setCommentQuantity(Integer commentQuantity)
    {
        this.commentQuantity = commentQuantity;
    }

    public Integer getPraiseQuantity()
    {
        return praiseQuantity;
    }

    public void setPraiseQuantity(Integer praiseQuantity)
    {
        this.praiseQuantity = praiseQuantity;
    }

    public Long getId()
    {
        return id;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public List<ArticleImage> getImages()
    {
        return images;
    }

    public void setImages(List<ArticleImage> images)
    {
        this.images = images;
    }

    public String getNickname()
    {
        return nickname;
    }

    public void setNickname(String nickname)
    {
        this.nickname = nickname;
    }

    public Long getPublishDate()
    {
        return publishDate;
    }

    public void setPublishDate(Date publishDate)
    {
        this.publishDate = publishDate.getTime();
    }

    public Long getUserId()
    {
        return userId;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public String getHeadImgUrl()
    {
        return headImgUrl;
    }

    public void setHeadImgUrl(String headImgUrl)
    {
        this.headImgUrl = headImgUrl;
    }

    public Status getStatus()
    {
        return status;
    }

    public void setStatus(Status status)
    {
        this.status = status;
    }

    public String getReason()
    {
        return reason;
    }

    public void setReason(String reason)
    {
        this.reason = reason;
    }

    public List<CommentJson> getComments()
    {
        return comments;
    }

    public void setComments(List<CommentJson> comments)
    {
        this.comments = comments;
    }

    public String getFullDate()
    {
        return fullDate;
    }

    public void setFullDate(Date fullDate)
    {
        if (null != fullDate)
        {
            Date today = new Date();
            if (Utils.isSameDate(fullDate, today))
            {
                this.fullDate = "今天";
            }
            else
            {
                Calendar calendar = Calendar.getInstance();
                calendar.setTime(fullDate);
                calendar.add(Calendar.DAY_OF_YEAR, 1);
                if (Utils.isSameDate(calendar.getTime(), today))
                {
                    this.fullDate = "昨天";
                }
            }
        }
    }

    public Boolean getPraise()
    {
        return praise;
    }

    public void setPraise(ArticlePraise articlePraise)
    {
        if (null == articlePraise || !articlePraise.getPraise())
        {
            this.praise = Boolean.FALSE;
        }
        else
        {
            this.praise = Boolean.TRUE;
        }
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }
}
